/* 全局样式 */
@use './var.scss' as *;

// hover按钮
.gi_hover_btn {
  background-color: transparent;
  border: 0 !important;

  &:hover {
    background: var(--color-secondary-hover) !important;
  }

  &:active {
    background: var(--color-secondary-active) !important;
  }
}

// 卡片组件，使body的高度自动撑满
.gi_card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .arco-card-body {
    box-sizing: border-box;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
  }
}

// 页面卡片，右侧有返回按钮
.gi_page_card {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: var(--margin);
  overflow: hidden;

  .arco-card-body {
    box-sizing: border-box;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
  }
}

// 卡片标题，标题左侧的伪类样式
.gi_card_title {
  .arco-card-header-title::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 50%;
    content: '';
    background-color: rgb(var(--warning-5));
    border-radius: 0 4px 4px 0;
    transform: translateY(-50%);
  }
}

// 使用场景，页面内容超出高度会自动滚动
.gi_page {
  box-sizing: border-box;
  flex: 1;
  padding: $margin;
  overflow-y: auto;
}

// 表格类名 高度自适应
.gi_table {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;

  >.arco-spin {
    height: auto;
    max-height: 100%;
    overflow: hidden;
  }
}

// 表格类名，高度自适应，分页始终固定在最底部
.gi_full_table {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;

  .arco-table-container {
    flex: 1;
    overflow: hidden;
  }

  .arco-table-scroll-y {
    border-right: 1px solid var(--color-border-table);
  }

  .arco-table-tr .arco-table-td:last-child,
  .arco-table-tr .arco-table-th:last-child {
    border-right: none;
  }

  .arco-table-content {
    .arco-scrollbar {
      &:last-child {
        flex: 1;

        &:not(.arco-scrollbar-both) {
          .arco-table-element {
            border-bottom: 1px solid var(--color-border-table);
          }
        }
      }
    }
  }
}

.gi_full_tabs {
  display: flex;
  flex: 1;
  flex-direction: column;

  .arco-tabs-content {
    flex: 1;
    padding-top: 0;

    .arco-tabs-content-list {
      height: 100%;
    }

    .arco-tabs-pane {
      height: 100%;
      overflow-y: auto;
    }
  }
}

// 编辑表格，表头的必填红色星号
.gi_column_require {
  .arco-table-th-title {
    &::before {
      padding-right: 2px;
      color: red;
      content: '*';
    }
  }
}

.gi_full_column {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

// 以下这些类名要放到下面，涉及到css权重优先级问题
.gi_mt {
  margin-top: $margin;
}

.gi_mb {
  margin-bottom: $margin;
}

.gi_ml {
  margin-left: $margin;
}

.gi_mr {
  margin-right: $margin;
}

.gi_mx {
  margin-right: $margin;
  margin-left: $margin;
}

.gi_my {
  margin-top: $margin;
  margin-bottom: $margin;
}

.gi_m0 {
  margin: 0;
}

.gi_pt {
  padding-top: $margin;
}

.gi_pb {
  padding-bottom: $margin;
}

.gi_pl {
  padding-left: $margin;
}

.gi_pr {
  padding-right: $margin;
}

.gi_px {
  padding-right: $padding;
  padding-left: $padding;
}

.gi_py {
  padding-top: $padding;
  padding-bottom: $padding;
}

.gi_p0 {
  padding: 0;
}

.gi_round {
  border-radius: 100px;
}

.gi_bg_1 {
  background-color: var(--color-bg-1);
}

.gi_bg_2 {
  background-color: var(--color-bg-2);
}

.gi_bg_3 {
  background-color: var(--color-bg-3);
}

.gi_bg_4 {
  background-color: var(--color-bg-4);
}

.gi_bg_5 {
  background-color: var(--color-bg-5);
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.flex-1 {
  flex: 1;
}

// 一般结合<a-row class="flex-column"></a-row>使用
.flex-column {
  flex-direction: column;
  overflow: hidden;
}

// 通用外边距
.gi_margin {
  margin: $margin;
}

// 通用内边距
.gi_padding {
  padding: $padding;
}

.gi_relative {
  position: relative;
}

.gi_absolute {
  position: absolute;
}

.gi_rotate_90deg {
  transform: rotate(90deg);
}

.gi_rotate_-90deg {
  transform: rotate(-90deg);
}

.gi_rotate_180deg {
  transform: rotate(180deg);
}

.gi_rotate_-180deg {
  transform: rotate(-180deg);
}

.gi_select_input {
  width: 120px !important;
}

.gi_search_input {
  width: 250px !important;
}

.gi_line_1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gi_line_2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.gi_line_3 {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.gi_line_4 {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.gi_line_5 {
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.gi_line_2,
.gi_line_3,
.gi_line_4,
.gi_line_5 {
  display: -webkit-box; // 弹性伸缩盒
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
}